// SPDX-License-Identifier: SOME IDENTIFIER
pragma solidity ^0.8.10;
contract WhileDoContract {
function getResult(uint number) public pure returns(uint) {
// while do statement
while (number < 10) {
number+= 25;
}
return number;
}
}
2.5.14.3 do-while Loop
Refer to the following code:
// SPDX-License-Identifier: SOME IDENTIFIER
pragma solidity ^0.8.10;
contract DoWhileContract {
function getResult(uint number) public pure returns(uint) {
// do while statement
do {
number+= 25;
} while (number < 10);
return number;
}
}
2.5.14.4 for Loop
Refer to the following code:
/// SPDX-License-Identifier: SOME IDENTIFIER
pragma solidity ^0.8.10;
contract ForLoopContract {